package com.tencreat.mall.controller.app;

import com.tencreat.common.core.HttpResult;
import com.tencreat.common.core.controller.BaseController;
import com.tencreat.domain.account.dto.ApiWithdrawDTO;
import com.tencreat.domain.mall.StoreWithdrawAudit;
import com.tencreat.service.account.IStoreWithdrawAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *  店铺提现 app
 *
 * @Author SLT
 * @Company: 深圳腾创互联科技有限公司
 * @link: https://tencreat.com
 * @Date: 2022/3/19 16:56
 */
@Api(tags="96-店铺提现记录api")
@RestController
@RequestMapping("/api/storeAudit")
public class StoreWithdrawAuditController extends BaseController {

    @Autowired
    private IStoreWithdrawAuditService storeWithdrawAuditService;


    @ApiOperation(value = "提现-店铺")
    @PostMapping(value = "/withdraw")
    public HttpResult<String> withdraw(@RequestBody ApiWithdrawDTO vo) {
        return storeWithdrawAuditService.withdraw(vo, getLoginCheck());
    }
    @ApiOperation("提现明细")
    @PostMapping("queryWithdrawRecord")
    public HttpResult<List<StoreWithdrawAudit>> queryWithdrawRecord() {
        return HttpResult.ok(storeWithdrawAuditService.queryWithdrawRecord(getLoginCheck().getAccountLogin().getUuid()));

    }
}
